using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Zonal
{
    /// <summary>
    /// <para>Zonal Histogram</para>
    /// <para>Creates a table and a histogram graph that show the frequency distribution of cell values on the value input for each unique zone.</para>
    /// <para>创建一个表和直方图，以显示每个唯一区域的值输入上像元值的频率分布。</para>
    /// </summary>    
    [DisplayName("Zonal Histogram")]
    public class ZonalHistogram : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ZonalHistogram()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_zone_data">
        /// <para>Input raster or feature zone data</para>
        /// <para><xdoc>
        ///   <para>The dataset that defines the zones.</para>
        ///   <para>The zones can be defined by an integer raster or a feature layer.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义区域的数据集。</para>
        ///   <para>区域可由整数栅格或要素图层定义。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_zone_field">
        /// <para>Zone field</para>
        /// <para><xdoc>
        ///   <para>The field that contains the values that define each zone.</para>
        ///   <para>It can be an integer or a string field of the zone dataset.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含定义每个区域的值的字段。</para>
        ///   <para>它可以是区域数据集的整数或字符串字段。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_value_raster">
        /// <para>Input value raster</para>
        /// <para>The raster that contains the values used to create the histogram.</para>
        /// <para>包含用于创建直方图的值的栅格。</para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output table</para>
        /// <para><xdoc>
        ///   <para>The output table file.</para>
        ///   <para>The format of the table is determined by the output location and path. By default, the output will be a geodatabase table if in a geodatabase workspace, and a dBASE table if in a file workspace.</para>
        ///   <para>The optional graph output is created from the information in the table.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出表文件。</para>
        ///   <para>表的格式由输出位置和路径决定。默认情况下，输出将为地理数据库表（如果位于地理数据库工作空间中），如果输出为dBASE表（如果位于文件工作空间中）。</para>
        ///   <para>可选的图形输出是根据表中的信息创建的。</para>
        /// </xdoc></para>
        /// </param>
        public ZonalHistogram(object _in_zone_data, object _zone_field, object _in_value_raster, object _out_table)
        {
            this._in_zone_data = _in_zone_data;
            this._zone_field = _zone_field;
            this._in_value_raster = _in_value_raster;
            this._out_table = _out_table;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Zonal Histogram";

        public override string CallName => "sa.ZonalHistogram";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "qualifiedFieldNames", "scratchWorkspace", "snapRaster", "tileSize", "transferDomains", "workspace"];

        public override object[] ParameterInfo => [_in_zone_data, _zone_field, _in_value_raster, _out_table, _out_graph, _zones_as_rows.GetGPValue()];

        /// <summary>
        /// <para>Input raster or feature zone data</para>
        /// <para><xdoc>
        ///   <para>The dataset that defines the zones.</para>
        ///   <para>The zones can be defined by an integer raster or a feature layer.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义区域的数据集。</para>
        ///   <para>区域可由整数栅格或要素图层定义。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature zone data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_zone_data { get; set; }


        /// <summary>
        /// <para>Zone field</para>
        /// <para><xdoc>
        ///   <para>The field that contains the values that define each zone.</para>
        ///   <para>It can be an integer or a string field of the zone dataset.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含定义每个区域的值的字段。</para>
        ///   <para>它可以是区域数据集的整数或字符串字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zone field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _zone_field { get; set; }


        /// <summary>
        /// <para>Input value raster</para>
        /// <para>The raster that contains the values used to create the histogram.</para>
        /// <para>包含用于创建直方图的值的栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input value raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_value_raster { get; set; }


        /// <summary>
        /// <para>Output table</para>
        /// <para><xdoc>
        ///   <para>The output table file.</para>
        ///   <para>The format of the table is determined by the output location and path. By default, the output will be a geodatabase table if in a geodatabase workspace, and a dBASE table if in a file workspace.</para>
        ///   <para>The optional graph output is created from the information in the table.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出表文件。</para>
        ///   <para>表的格式由输出位置和路径决定。默认情况下，输出将为地理数据库表（如果位于地理数据库工作空间中），如果输出为dBASE表（如果位于文件工作空间中）。</para>
        ///   <para>可选的图形输出是根据表中的信息创建的。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Output graph name</para>
        /// <para><xdoc>
        ///   <para>The name of the output graph for display.</para>
        ///   <para>The graph is listed in the Contents pane under Standalone Tables.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要显示的输出图形的名称。</para>
        ///   <para>该图表列在内容窗格的独立表下。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output graph name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_graph { get; set; } = null;


        /// <summary>
        /// <para>Zones as rows in output table</para>
        /// <para><xdoc>
        ///   <para>Specifies how the values from the input value raster will be represented in the output table.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Zones will be represented as fields. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Zones will be represented as rows.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输入值栅格中的值在输出表中的表示方式。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 区域将表示为字段。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 区域将表示为行。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Zones as rows in output table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _zones_as_rows_value _zones_as_rows { get; set; } = _zones_as_rows_value._false;

        public enum _zones_as_rows_value
        {
            /// <summary>
            /// <para>ZONES_AS_FIELDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ZONES_AS_FIELDS")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>ZONES_AS_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ZONES_AS_ROWS")]
            [GPEnumValue("true")]
            _true,

        }

        public ZonalHistogram SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, bool? qualifiedFieldNames = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, bool? transferDomains = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, qualifiedFieldNames: qualifiedFieldNames, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, transferDomains: transferDomains, workspace: workspace);
            return this;
        }

    }

}